package com.df.orderserver.api.order.controller;

import com.df.orderserver.api.order.bean.UserInfo;
import com.df.orderserver.api.order.service.IUserFeignService1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: lichong
 * @email: li_chong@massclouds
 * @Date: 2020/5/13 11:43
 * @Description:
 */
@RequestMapping("/api/feign")
@RestController
public class UserFeignController {
    @Autowired
    private IUserFeignService1 userFeignService1;

    @GetMapping("name")
    public String getUserName(String name) {
        return userFeignService1.getUserName(name);
    }


    @GetMapping("info")
    public UserInfo getInfo() {
        UserInfo userInfo = new UserInfo();
        userInfo.setId(1);
        userInfo.setUserName("小花");
        return userFeignService1.getUserInfo(userInfo);
    }
}
